package com.business.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.business.system.dao.TabRepairWxgsMapper;
import com.business.system.pojo.TabRepairWxgs;
import com.business.system.pojo.TabRepairWxgsExample;
import com.business.system.service.ITabRapairWXGSService;

@Service
public class TabRepairWXGSServiceImpl implements ITabRapairWXGSService {

	@Autowired
	private TabRepairWxgsMapper repairWxgsMapper;

	@Override
	public int insert(TabRepairWxgs entity) throws RuntimeException {
		// TODO Auto-generated method stub
		return this.repairWxgsMapper.insert(entity);
	}

	@Override
	public int update(TabRepairWxgs entity) throws RuntimeException {
		// TODO Auto-generated method stub
		return this.repairWxgsMapper.updateByPrimaryKey(entity);
	}

	@Override
	public int delete(int id) throws RuntimeException {
		// TODO Auto-generated method stub
		return this.repairWxgsMapper.deleteByPrimaryKey(id);
	}

	@Override
	public TabRepairWxgs findById(int id) throws RuntimeException {
		// TODO Auto-generated method stub
		return this.repairWxgsMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<TabRepairWxgs> findList(TabRepairWxgs entity)
			throws RuntimeException {
		// TODO Auto-generated method stub
		TabRepairWxgsExample example = new TabRepairWxgsExample();
		if (entity.getBelongId() != null && !"".equals(entity.getBelongId())) {
			example.createCriteria().andBelongIdEqualTo(entity.getBelongId());
		}
		return this.repairWxgsMapper.selectByExample(example);
	}
}
